package com.xc.hotelmgr.order.modules.order.service.impl;

import com.xc.hotelmgr.order.common.utils.Query;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xc.hotelmgr.order.common.utils.PageUtils;

import com.xc.hotelmgr.order.modules.order.dao.OrderDao;
import com.xc.hotelmgr.order.modules.order.entity.OrderEntity;
import com.xc.hotelmgr.order.modules.order.service.OrderService;


@Service("orderService")
public class OrderServiceImpl extends ServiceImpl<OrderDao, OrderEntity> implements OrderService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<OrderEntity> page = this.page(
                new Query<OrderEntity>().getPage(params),
                new QueryWrapper<OrderEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public Integer sqlUpdateOrderStatus(Map<String,Object> params) {

       return baseMapper.sqlUpdateOrderStatus(params);
    }

    @Override
    public OrderEntity sqlSelectByBuyOrdId(Long buyOrdId,Integer channel) {
       return baseMapper.sqlSelectByBuyOrdId(buyOrdId,channel);
    }

    @Override
    public OrderEntity sqlselectByOrderCode(Long orderCode) {

        return baseMapper.sqlselectByOrderCode(orderCode);
    }

    @Override
    public void updateOlnyOrderStatus(Map<String, Object> params) {
        baseMapper.updateOlnyOrderStatus(params);
    }

}